<%include("/common/list-top.html",{title:"区域位置管理",css:[ctxPath+"/css/basice.css",ctxPath+"/ztree/css/metroStyle.css"]}){}
%>

<div class="container-fluid">
    <div class="page-head-nav">
        <div class="row">
            <div class="col-xs-11">
                <ol class="breadcrumb">
                    <li><a href="${ctxPath}"><i class="icon icon-home"></i>工作台</a></li>
					<li>基础数据管理</li>
					<li><a href="${ctxPath}/position">区域位置</a></li>
				</ol>
			</div>
			<div class="col-xs-1">
				<a class="btn btn-link" >新增</a>
			</div>
        </div>
    </div>
<div class="row">
	<!--区域数据  -->
	<div class="col-xs-2">
		<div class="panel"  style="margin-right: -10px; margin-left: -10px;">
			<div class="panel-heading">
				<a href="/bartalks/position"><i class="icon icon-bolt"></i> <span class="title">区域</span></a>
				<div class="panel-actions pull-right">
					<a data-toggle="tooltip" title="新增" id="add" data-original-title="新增">
						<i class="icon icon-file-o"></i>
					</a>
					<a data-toggle="tooltip" title="编辑" id="edit" data-original-title="编辑">
						<i class="icon-pencil"> </i>
					</a>
					<a data-toggle="tooltip" title="删除" id="remove" data-original-title="删除">
						<i class="icon-trash"> </i>
					</a>
				</div>
			</div>
			<div class="panel-body" style="overflow-x: hidden;">
				<input type="hidden" id="long_number">
				<input type="hidden" id="regName">
				<ul id="treeDemo" class="ztree"></ul>
			</div>
		</div>
	</div>

	<!--位置数据表格 -->
	<div class="col-xs-10">
		<div class="row listui" id="mainUI">
			<div class="col-xs-12 ">
				<#listTable url="/bartalks/position"
					fields="position_code,位置编码,sort,no-query|position_name,位置名称,sort,query|position_desc,位置描述,no-sort,query" />
			</div>
		</div>
	</div>
</div>

<!-- 新增 -->
<div class="modal fade" id="addRegion">
	<div class="modal-dialog" style="width: 500px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
				</button>
				<h4 class="modal-title">添加区域</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" id="addTreeForm">
						<input type="hidden" name='parentRegCode' id="addParentRegionNumber">
						<input type="hidden" name='parentRegId' id="addParentRegionIdNumber">
						<input type="hidden" name='longCode' id="addLongNumber">
					<div class="row">
						<div class="col-xs-2">
							<label>区域编码<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="text" class="form-control" id="addRegionNumber" name="regionCode" maxlength="20" placeholder="区域编码" readonly="readonly">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-xs-2">
							<label>区域名称<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="text" class="form-control" id="region_name" name="regionName" maxlength="20" placeholder="区域名称">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-xs-2">
							<label>区域描述</label>
						</div>
						<div class="col-xs-8">
							<textarea id="region_desc" name="regionDesc" rows="5" cols="40"></textarea>
						</div>
					</div>
				</form>
			</div>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			<button type="button" class="btn btn-primary" id="ok">确定</button>
		</div>
	</div>
</div>


<!-- 编辑 -->
<div class="modal fade" id="editRegion">
	<div class="modal-dialog" style="width: 500px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
				</button>
				<h4 class="modal-title">编辑</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" id="editRegForm">
					<!-- <input type="hidden" name='regionNumber' id="editRegionNumber"> -->
					<input type="hidden" name='parentRegCode' id="editParentRegionNumber">
					<input type="hidden" name='longCode' id="editLongNumber">
					<div class="row">
						<div class="col-xs-2">
							<label>区域编码<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="hidden" name="id" id="id">
							<input type="text" class="form-control" id="editRegionNumber" maxlength="20" placeholder="编码" disabled="disabled">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-xs-2">
							<label>区域名称<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="text" class="form-control" id="regionName" name="regionName" maxlength="20" placeholder="区域名称">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-xs-2">
							<label>区域描述</label>
						</div>
						<div class="col-xs-8">
							<textarea id="regionDesc" name="regionDesc" rows="5" cols="40"></textarea>
						</div>
					</div>
				</form>
			</div>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			<button type="button" class="btn btn-primary" id="upate">确定</button>
		</div>
	</div>
</div>

<!-- 位置 -->

<div class="modal fade" id="PositionMapModal">
  <div class="modal-dialog modal-fullscreen" >
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
        <h4 class="modal-title">新增位置</h4>
      </div>
      <div class="modal-body row">
        <div class="col-xs-3">
        <form class="form-horizontal" id="PositionForm">
        <input type="hidden" name="id" id='PositionId'>
        <input type="hidden" name="longCode" id='long_code'>
        <input type="hidden" name="parentRegPositionCode" id="region_number">
		  <div class="form-group">
		    <label for="position_code" class="col-sm-2">位置编码</label>
		    <div class="col-sm-10">
		     <input type="text" class="form-control" id="position_code" name="positionCode"  placeholder="位置编码" readonly="readonly" >
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="position_name" class="col-sm-2">位置名称</label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="position_name" name="positionName"  placeholder="位置名称">
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="position_desc" class="col-sm-2">位置描述</label>
		    <div class="col-sm-10">
		  	  <textarea id="position_desc" name="positionDesc" rows="5" cols="50"></textarea>
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="longitude" class="col-sm-2"><span style="color: red;">* </span>经度</label>
		    <div class="col-sm-10">
		    	<input type="text" class="form-control" name="longitude" id="longitude" placeholder="请点击地图获取" readonly="readonly"/>
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="latitude" class="col-sm-2"><span style="color: red;">* </span>纬度</label>
		    <div class="col-sm-10">
		  	   <input type="text"  class="form-control" name="latitude" id="latitude" placeholder="请点击地图获取" readonly="readonly"/>
		    </div>
		  </div>
		   <div class="form-group">
		    <div class="col-sm-8"></div>
		    <div class="col-sm-2">
		      <button type="button" class="btn btn-default MapModalClose">关闭</button>
		    </div>
		    <div class="col-sm-2">
		      <button type="button"  class="btn hidden   btn-primary MapModalAddDetermine">确定</button>
		      <button type="button"  class="btn hidden   btn-primary MapModalEditDetermine">确定</button>
		    </div>
		  </div>
        </form>
        </div>
        <div class="col-xs-9">
	        <div class="col-xs-12">
		        <div class="input-group">
			       <span class="input-group-addon"><i class="icon-search"></i></span>
			       <input type="text" class="form-control"  id="searchKeyword">
			       <span class="input-group-btn">
			       <button class="btn btn-primary" type="button" id="mapsearch">搜索</button>
			       </span>
			    </div>
			     <div class="input-group" style="margin: 5px 0px;">
			       <span id="CurrentLocation" style="color: #2815b5;">当前定位:正在定位中....</span>
			    </div>
	        	<div style="width:100%;height:700px;border:#ccc solid 1px;" id="allmap"></div>
	        </div>
        </div>
      </div>
    </div>
  </div>
</div>
<%include("/common/list-bottom.html",{js:[ctxPath+"/ztree/js/jquery.ztree.all.min.js",ctxPath+"/js/basics/region.js",ctxPath+"/js/basics/position-list2.js","https://maps.googleapis.com/maps/api/js?key=AIzaSyDkdhQ3w1hZ0ZSU7MOIxTYtnXq0qrY7jS0&callback=initMap"]}){} %>

